package cn.edu.cug.cs.gtl.apps.gepspacex.modeller.actions;

import cn.edu.cug.cs.gtl.apis.render.Render;
import cn.edu.cug.cs.gtl.apis.ui.AbstractApplication;
import cn.edu.cug.cs.gtl.apis.ui.model3duis.Model3dUIApp;
import cn.edu.cug.cs.gtl.apis.ui.modeller.ModellerApp;
import cn.edu.cug.cs.gtl.apis.render.viewers.Viewer;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class OpenInventorStudioActionListener  implements ActionListener {
    AbstractApplication theApp;
    public OpenInventorStudioActionListener(AbstractApplication theApp){
        this.theApp = theApp;
    }
    @Override
    public void actionPerformed(ActionEvent e) {
        Viewer viewer = getModel3dUIApp().getRenderPanel().getViewer();
        getModel3dUIApp().getFactory().createTune().start(viewer.getRenderArea().getSceneInteractor());
    }


    public Render getRender() {
        return ((ModellerApp)theApp).getModel3dUIApp().getRender();
    }

    public Viewer getViewer(){
        return ((ModellerApp)theApp).getModel3dUIApp().getViewer();
    }

    public Model3dUIApp getModel3dUIApp(){
        return ((ModellerApp)theApp).getModel3dUIApp();
    }
}
